import request from '@/utils/request'

// 问卷列表
export function getQuestionsList(query) {
  return request({
    url: '/jbl-user-center/api/admin/v1/questionnaire/list',
    method: 'get',
    params: query
  })
}
// 新增问卷
export function addQuestionsList(data) {
  return request({
    url: '/jbl-user-center/api/admin/v1/questionnaire/add',
    method: 'post',
    data
  })
}
// 删除问卷
export function deleteQuestionsList(query) {
  return request({
    url: '/jbl-user-center/api/admin/v1/questionnaire/delete',
    method: 'get',
    params: query
  })
}
// 问卷详情
export function questionsDetail(query) {
  return request({
    url: '/jbl-user-center/api/admin/v1/questionnaire/info',
    method: 'get',
    params: query
  })
}
// 新增题目
export function addQuestions(data) {
  return request({
    url: '/jbl-user-center/api/admin/v1/questionnaire/addTopic',
    method: 'post',
    data
  })
}
// 删除题目
export function deleteQuestions(query) {
  return request({
    url: '/jbl-user-center/api/admin/v1/questionnaire/deleteTopic',
    method: 'get',
    params: query
  })
}
// ------------------------------------
// 修改题目
export function editQuestions(data) {
  return request({
    url: '/jbl-user-center/api/admin/v1/questionnaire/updateTopic',
    method: 'post',
    data
  })
}
// 新增答案-批量
export function addQuestionsAnswers(data) {
  return request({
    url: '/jbl-user-center/api/admin/v1/questionnaire/addAnswers',
    method: 'post',
    data
  })
}
// 删除答案
export function delQuestionsAnswers(query) {
  return request({
    url: '/jbl-user-center/api/admin/v1/questionnaire/deleteAnswerId',
    method: 'get',
    params: query
  })
}
// 用户填写题目
export function userWriteTopicName(data) {
  return request({
    url: '/jbl-user-center/api/admin/v1/questionnaire/addAccountQuestionnaire',
    method: 'post',
    data
  })
}
// 获取填写该答案的用户列表
export function getWriteAnswerUser(query) {
  return request({
    url: '/jbl-user-center/api/admin/v1/questionnaire/pageAccount',
    method: 'get',
    params: query
  })
}

